
/*
 * Copyright 2002-2022 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2022原作者。
 *
 *根据Apache许可证2.0版（“许可证”）许可；
 *除非符合许可证的规定，否则您不得使用此文件。
 *您可以在以下网址获取许可证副本
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，否则软件
 *根据许可证分发是在“按原样”的基础上分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限的特定语言，请参阅许可证
 *许可证下的限制。
 */

package org.springframework.context;

import org.springframework.beans.factory.Aware;

/**
 * Interface to be implemented by any object that wishes to be notified of the
 * {@link MessageSource} (typically the ApplicationContext) that it runs in.
 *
 * <p>Note that the {@code MessageSource} can usually also be passed in as a bean
 * reference (via arbitrary bean properties or constructor arguments), because
 * it is defined as a bean with name {@code "messageSource"} in the application
 * context.
 *
 * @author Juergen Hoeller
 * @author Chris Beams
 * @since 1.1.1
 * @see ApplicationContextAware
 */
/**
 *要由希望被通知的任何对象实现的接口
 *｛@link MessageSource｝（通常是ApplicationContext）。
 *
 *＜p＞请注意，｛@code MessageSource｝通常也可以作为bean传入
 *引用（通过任意bean财产或构造函数参数），因为
 *它在应用程序中被定义为名称为{@code“messageSource”}的bean
 *上下文。
 *
 *@作者Juergen Hoeller
 *@作者Chris Beams
 *@自1.1.1起
 *@请参阅ApplicationContextAware
 */
public interface MessageSourceAware extends Aware {

	/**
	 * Set the {@link MessageSource} that this object runs in.
	 * <p>Invoked after population of normal bean properties but before an init
	 * callback like InitializingBean's afterPropertiesSet or a custom init-method.
	 * Invoked before ApplicationContextAware's setApplicationContext.
	 * @param messageSource message source to be used by this object
	 */
	/**
	 *设置此对象运行的｛@link MessageSource｝。
	 *<p>在填充普通bean财产之后但在初始化之前调用
	 *回调，如InitializingBean的afterPropertiesSet或自定义init方法。
	 *在ApplicationContextAware的setApplicationContext之前调用。
	 *@param messageSource此对象要使用的消息源
	 */
	void setMessageSource(MessageSource messageSource);

}
